package com.soa.zuul.entity;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * GatewayUserHttpAuth entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "gateway_user_http_auth", schema = "public")
public class GatewayUserHttpAuth implements java.io.Serializable {

	// Fields

	private String id;
	private GatewayUser gatewayUser;
	private GatewayHttpApi gatewayHttpApi;
	private String state;
	private Timestamp applyTime;

	// Constructors

	/** default constructor */
	public GatewayUserHttpAuth() {
	}

	/** minimal constructor */
	public GatewayUserHttpAuth(String id) {
		this.id = id;
	}

	/** full constructor */
	public GatewayUserHttpAuth(String id, GatewayUser gatewayUser,
			GatewayHttpApi gatewayHttpApi, String state, Timestamp applyTime) {
		this.id = id;
		this.gatewayUser = gatewayUser;
		this.gatewayHttpApi = gatewayHttpApi;
		this.state = state;
		this.applyTime = applyTime;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public GatewayUser getGatewayUser() {
		return this.gatewayUser;
	}

	public void setGatewayUser(GatewayUser gatewayUser) {
		this.gatewayUser = gatewayUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "api_id")
	public GatewayHttpApi getGatewayHttpApi() {
		return this.gatewayHttpApi;
	}

	public void setGatewayHttpApi(GatewayHttpApi gatewayHttpApi) {
		this.gatewayHttpApi = gatewayHttpApi;
	}

	@Column(name = "state", length = 2)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "apply_time", length = 22)
	public Timestamp getApplyTime() {
		return this.applyTime;
	}

	public void setApplyTime(Timestamp applyTime) {
		this.applyTime = applyTime;
	}

}